package com.boruiimage.demo.service;

import com.boruiimage.demo.doMain.Result;
import com.boruiimage.demo.doMain.memberuser;
import com.boruiimage.demo.mapperDao.filePart;
import com.boruiimage.demo.mapperDao.registerMapperDao;
import com.boruiimage.demo.repository.filePartDao;
import com.boruiimage.demo.utils.imgCard;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Calendar;
import java.util.Random;

@Service
public class filePartDaoImpl implements filePartDao {
    Result rs=new Result();
    @Autowired
    filePart fp;
    //添加图片信息
    @Override
    public Result addImg(String userName, String imgName, String imgDetil, String imgResult,String imgType,Integer payMoney,String payType) {
        Result rs=new Result();
        int i=fp.addImg(userName,imgName,imgDetil,imgResult,imgType,0,"微信",0, imgCard.Show());
        if(i>0){
           rs.setCode(1);
      }else {
            rs.setCode(0);
        }
        return rs;
    }
    @Autowired
    registerMapperDao rmb;
    @Override
    public memberuser us(String userName) {
        return rmb.us(userName);
    }
}
